set(SDK_HYDRA "" CACHE PATH "libSixense path for Razer Hydra")
if(SDK_HYDRA AND opentrack-intel)
    otr_module(tracker-hydra)
    target_include_directories(opentrack-tracker-hydra SYSTEM PUBLIC ${SDK_HYDRA}/include ${SDK_HYDRA}/include/sixense_utils)
    if(opentrack-64bit)
        set(six4 _x64)
    else()
        set(six4 "")
    endif()
    if(WIN32)
        if(MSVC)
            set(dir lib)
            set(ext lib)
        else()
            set(dir bin)
            set(ext dll)
        endif()
        if (opentrack-64bit)
            set(part "x64")
        else()
            set(part "win32")
        endif()
        set(lib "${SDK_HYDRA}/${dir}/${part}/release_dll/sixense${six4}.${ext}")
        set(dll "${SDK_HYDRA}/bin/${part}/release_dll/sixense${six4}.dll")
        install(FILES "${dll}" DESTINATION ${opentrack-libexec} PERMISSIONS ${opentrack-perms-exec})
        target_link_libraries(opentrack-tracker-hydra "${lib}")
    else()
        if(APPLE)
            set(dest ".")
            set(part "release_dll")
            set(soext "dylib")
            set(plat "osx")
        else() # assume Linux
            set(dest "${opentrack-libexec}")
            set(part "release")
            set(soext "so")
            set(plat "linux")
        endif()
        set(lib "libsixense${six4}.${soext}")
        target_link_libraries(opentrack-tracker-hydra "${SDK_HYDRA}/lib/${plat}${six4}/${part}/${lib}")
        install(FILES "${SDK_HYDRA}/lib/${plat}${six4}/${part}/${lib}" DESTINATION ${opentrack-libexec} PERMISSIONS ${opentrack-perms-exec})
    endif()
endif()
